{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Control Flow \n",
    "\n",
    "* if, while,for,\n",
    "  * break continue\n",
    "\n",
    "* Indentation\n",
    "\n",
    "* Coding Styles\n",
    "\n",
    "In the programs we have seen till now, there has always been `a series of statements` faithfully executed by Python in `exact top-down order`.\n",
    "\n",
    "What if you wanted to change `the flow of how it works?` For example, you want the program to take some decisions and do different\n",
    "things depending on different situations, such as printing 'Good Morning' or 'Good Evening' depending on the time of the day?\n",
    "\n",
    "As you might have guessed, this is achieved using` control flow statements`. \n",
    "\n",
    "There are **three** control flow statements in Python \n",
    "\n",
    "* <b style=\"color:blue\">if , for , while</b>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 1 Branching Programs: `if`\n",
    "\n",
    "Branching programs are more interesting. The simplest branching statement is a conditional. As shown in the boxed-in part of the folloewing Figure\n",
    "\n",
    "![if-else](./img/if-else.jpg)\n",
    "\n",
    "The  conditional statement has three parts:\n",
    "\n",
    "* `a test`,  an expression that evaluates to either True or False;\n",
    "\n",
    "* `a block of code` that is executed if the test evaluates to `True`; \n",
    "\n",
    "* `an optional block of code` that is executed if the test evaluates to `False`.\n",
    "\n",
    "After a conditional statement is executed, execution resumes at the code following the statement.\n",
    "\n",
    "In Python, a <b style=\"color:blue\">conditional statement</b> has the form\n",
    "\n",
    "* The <b style=\"color:blue\">colon (:)</b> ends the `if expression/else` \n",
    "\n",
    "```python\n",
    "if Boolean expression:\n",
    "    block of code\n",
    "else:\n",
    "    block of code\n",
    "```\n",
    "or \n",
    "\n",
    "```python\n",
    "if Boolean expression:\n",
    "   block of code\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "x=25\n",
    "# the following program that prints “Even” if the value of the variable x is even \n",
    "# and “Odd” otherwise:\n",
    "if x % 2 == 0:\n",
    "    print('Even')\n",
    "    print(x)\n",
    "    print(x%2)\n",
    "else:\n",
    "    print('Odd')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### <b style=\"color:blue\">Indentation</b>    \n",
    " "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Most other programming languages use some sort of **bracketing symbols** to delineate blocks of code, e.g.,\n",
    "\n",
    "* <b style=\"color:blue\">C encloses blocks in braces, { }</b>.\n",
    "```cpp\n",
    "if(boolean_expression)\n",
    "{\n",
    "   // block of code\n",
    "     int i=1;\n",
    "                 double f=2   \n",
    "}\n",
    "else\n",
    "{\n",
    "   block of code\n",
    "}\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Python is `unusual` in using <b style=\"color:blue\">indentation </b>this way:\n",
    " \n",
    "* <b style=\"color:blue\">Indentation</b> is semantically meaningful in Python: <b style=\"color:blue\">delineate blocks of code</b>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "An advantage of the Python approach is that it ensures that the \n",
    "\n",
    "* **visual structure** of a program is an **accurate** representation of the **semantic structure** of that program.\n",
    "\n",
    "![block](./img/python-block.jpg)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**1 Improper indent: `Syntax` error**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "x=12\n",
    "# the following program that prints “Even” if the value of the variable x is even \n",
    "# and “Odd” otherwise:\n",
    "if x % 2 == 0:\n",
    "    print('Even')\n",
    "print(x)\n",
    "    print(x%2)\n",
    "else:\n",
    "    print('Odd')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "x=12\n",
    "# the following program that prints “Even” if the value of the variable x is even \n",
    "# and “Odd” otherwise:\n",
    "if x % 2 == 0:\n",
    "    print('Even')\n",
    "print(x)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**2 Improper indentation: `Semantic` error**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "x=10\n",
    "if x > 20:rongy\n",
    "    x =11/x\n",
    "    x +=10 # x add 10 only >20\n",
    "print(x)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "x=10\n",
    "if x > 20:\n",
    "    x=12/34\n",
    "    x+=23\n",
    "print(x)   \n",
    "    "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Nested conditionals\n",
    "\n",
    "When either the true block or the false block of a conditional contains `another` conditional, the conditional statements are said to be **nested**. In the code below, there are nested conditionals in both branches of the top-level `if` statement"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#x=2*3*7\n",
    "\n",
    "#x=2*7\n",
    "\n",
    "x=3*7\n",
    "\n",
    "# the conditional statements are nested.\n",
    "if x % 2 == 0:\n",
    "   \n",
    "    if x % 3 == 0:\n",
    "        print('Divisible by 2 and 3')\n",
    "    else:\n",
    "        print('Divisible by 2 and not by 3')\n",
    "        \n",
    "elif x % 3 == 0:    # elif : else  if\n",
    "    print('Divisible by 3 and not by 2')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**NOTE:** The `elif` in the above code stands for  `else if`."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "It is often convenient to use `a compound Boolean expression` in the test of a conditional, for example,"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "x=1\n",
    "y=10\n",
    "z=87\n",
    "if x < y and x < z:  # compound Boolean expressions \n",
    "    print('x is least')\n",
    "elif y < z:\n",
    "    print('y is least')\n",
    "else:\n",
    "    print('z is least')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "## 2 The while loop\n",
    "\n",
    "**Conditional Iteration：The while loop**\n",
    "\n",
    "When we want a program to do the same thing many times, we can use iteration\n",
    "\n",
    "A generic iteration (also called looping) mechanism is shown in the boxed-in part of the following. \n",
    "\n",
    "![while](./img/while.jpg)\n",
    "\n",
    "Like a conditional statement, it begins with a test. If the test evaluates to True, the program executes the loop body once, and then goes back to reevaluate the test. This process is repeated until the test evaluates to False, after which control passes to the code following the iteration statement.\n",
    "\n",
    "```python\n",
    "\n",
    "initial value  # ！！！\n",
    "while Boolean expression:\n",
    "      block of code\n",
    "```\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "4\n",
      "3\n",
      "2\n",
      "1\n",
      "0\n"
     ]
    }
   ],
   "source": [
    "n = 5\n",
    "while n > 0:\n",
    "    n -= 1\n",
    "    print(n)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "str1=\"Python\"\n",
    "while str1:\n",
    "    print()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Line Continuation. \n",
    "\n",
    "```python\n",
    "print(str(x) + '*' + str(x) + ' = '\n",
    "      + str(ans))\n",
    "```\n",
    "* Python's `implicit` line joining inside `parentheses(), brackets[] and braces{}`.\n",
    "\n",
    "\n",
    "* `\\` continuation. \n",
    "\n",
    "\n",
    "\n",
    "#### A Implicit line joining \n",
    "\n",
    "* inside `parentheses(), brackets[] and braces{}`"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'123456'"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a =( '1' + '2' \n",
    "      + '3' +   \n",
    "     '4' + '5' \n",
    "      + '6'\n",
    "   )\n",
    "a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['123456']"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a=['1' + '2' + '3' +\n",
    "     '4' + '5' + '6'  ]\n",
    "a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'123456'}"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a={'1' + '2' + '3' +\n",
    "    '4' + '5' + '6'\n",
    "  }\n",
    "a"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### B  “\\” continuation "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "a = '1' + '2' + '3' +  '4' + '5' +'6'\n",
    "a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'123456'"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a = '1' + '2' + '3' +  \\\n",
    "    '4' + '5' + '6'\n",
    "a"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### C Syntax error caused by line continuation without end\n",
    "\n",
    "* [Problem and Solution:报没有错误语句的“SyntaxError\"](https://gitee.com/thermalogic/home/blob/B2021/guide/doc/Problem_Solution.md#%E6%8A%A5%E6%B2%A1%E6%9C%89%E9%94%99%E8%AF%AF%E8%AF%AD%E5%8F%A5%E7%9A%84syntaxerror)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "multilines=((1+2)+2+1+2++2+1+2++2+1+2++\n",
    "nextline=3+4"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 3 For Loops\n",
    "\n",
    "Python provides a language mechanism, the <b>for</b> loop,that can be used to simplify programs containing this kind of iteration: Each iterates over a sequence of integers.\n",
    "\n",
    "The general form of a for statement is :\n",
    "```python\n",
    "for variable in sequence:\n",
    "    code block\n",
    "```\n",
    "\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 3.1 Iterate over characters of a string\n",
    "\n",
    "The `for` statement can be used in conjunction with the in operator to conveniently `iterate over characters of a string`. For example,"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "for s in \"abcgdg\":\n",
    "    s=4*s\n",
    "    print(s)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "sums the digits in the string denoted by the literal `'12345678`' and prints the total"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "total = 0\n",
    "for char in '123456789':\n",
    "    total = total + int(char)\n",
    "print(total)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 3.2 Range type\n",
    "\n",
    "https://docs.python.org/3/library/stdtypes.html#ranges\n",
    "\n",
    "The range type represents `an immutable sequence of numbers` and is commonly used for looping a specific number of times in `for loops.`\n",
    "\n",
    "The `range` type may takes one,two or three integer arguments: \n",
    "\n",
    "```python\n",
    "range(stop)\n",
    "range(start, stop)\n",
    "range(start, stop[, step])\n",
    "```\n",
    "* start: The value of the start parameter (or 0 if the parameter was not supplied)\n",
    "\n",
    "* stop: The value of the stop parameter\n",
    "\n",
    "* step: The value of the step parameter (or 1 if the parameter was not supplied)\n",
    "\n",
    "   * If `start` is omitted it defaults to 0, \n",
    "\n",
    "   * If `step` is omitted it defaults to 1.\n",
    "\n",
    "```python\n",
    " range(4)-> range(0, 4)->range(0, 4,1) ->[0, 1, 2,3]\n",
    "```\n",
    "\n",
    "```python\n",
    " range(4,10)-> range(4,10,1)->[4 5 6 7 8 9]\n",
    " \n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "print(\"range(4)\")\n",
    "for i in range(4):\n",
    "    print(i)\n",
    "print(\"\\nrange(4,10)\")\n",
    "for i in range(4,10):\n",
    "    print(i) "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**`range(start,stop,step)`**\n",
    "\n",
    "* It produces the progression `start, start + step, start + 2*step`, etc.\n",
    "\n",
    "```python\n",
    "range(5,40,10) -> [5,15,25,35]\n",
    "```\n",
    "* If step is `negative`, the last element is the smallest integer `start + i*step` greater than stop.\n",
    "\n",
    "```python\n",
    "range(40,5,-10)-> [40,30,20,10]\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "print(\"range(5,40,10)\")\n",
    "for i in range(5,40,10):\n",
    "    print(i)\n",
    "print(\"\\nrange(40,5,-10)\")\n",
    "for i in range(40,5,-10):\n",
    "    print(i) "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 4 `break` and `continue` \n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "![c-b](./img/continue-break.jpg)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "### 4.1 The `break`\n",
    "\n",
    "The `break` statement is used to **break out** of a `loop` statement \n",
    "\n",
    "* stop the execution of a looping statement, \n",
    " * even if the loop condition has not become False \n",
    " * or the sequence of items has not been completely iterated over.\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**stop the execution of a looping statement even if the loop condition has not become False**\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "n = 5\n",
    "while n > 0:\n",
    "    n -= 1\n",
    "    if n == 2:\n",
    "        break\n",
    "    print(n)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**stop the sequence of items has not been completely iterated over**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "for n in range(5,1,-1):\n",
    "    n -= 1\n",
    "    if n == 2:\n",
    "        break\n",
    "    print(n)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 4.2 The `continue` \n",
    "\n",
    "The `continue` statement is used to tell Python to \n",
    "\n",
    "* **skip** the **rest** of the statements in the current loop block and to continue to the **next iteration** of the loop.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "n = 5\n",
    "while n > 0:\n",
    "    n -= 1\n",
    "    if n == 2:\n",
    "        continue\n",
    "    print(n)\n",
    "print('Loop ended')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "for n in range(5,1,-1):\n",
    "    n -= 1\n",
    "    if n == 2:\n",
    "        continue\n",
    "    print(n)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##  5  pass Statement\n",
    "\n",
    "The `pass` statement is a null operation; nothing happens when it executes. \n",
    "\n",
    "It is used as a **placeholder** when a statement is required **syntactically**. \n",
    "\n",
    "* **your code will eventually go, but has not been written yet** \n",
    "\n",
    "* **no code needs to be executed**\n",
    "\n",
    "**your code will eventually go, but has not been written yet** "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "x=25\n",
    "if x % 2 == 0:\n",
    "    print('Even')\n",
    "    print(x)\n",
    "    print(x%2)\n",
    "else:\n",
    "    pass\n",
    "    #print('Odd')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    ">**the placeholder  in C/C++**\n",
    " >\n",
    " >* empty block`{}` or empty line `;`\n",
    ">\n",
    ">```cpp\n",
    ">if (/* some condition */)\n",
    ">{   \n",
    ">    }\n",
    ">else\n",
    ">{  \n",
    ">   }\n",
    ">\n",
    "> \n",
    ">if (/* some condition */)\n",
    ">  ;\n",
    ">else\n",
    ">  ;\n",
    ">```"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 6 Coding Styles\n",
    "\n",
    "Python Developer's Guide，Coding Styles\n",
    "\n",
    "https://www.python.org/dev/\n",
    "\n",
    "**PEP**：Python Enhancement Proposals"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 6.1 The Zen of Python ,PEP20 (Python Enhancement Proposals)\n",
    "\n",
    "https://www.python.org/dev/peps/pep-0020/"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Easter Egg\n",
    "import this"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 6.2 Coding convention: PEP8\n",
    "\n",
    "[PEP 8 -- Style Guide for Python Code](https://www.python.org/dev/peps/pep-0008/)\n",
    "\n",
    "The recommended styles are:\n",
    "\n",
    "* Use `4 spaces` for indentation. `Don't use tab`.\n",
    "\n",
    "* `Lines shall not exceed `79 characters.\n",
    "\n",
    "* Use `blank lines` to separate `functions and classes.`\n",
    "\n",
    "* Use `a space` before and after `an operator.`\n",
    "\n",
    "​\n",
    "\n",
    "#### Packages about pep8\n",
    "\n",
    "* `pycodestyle` :the tool to check your Python code against some of the style conventions in PEP 8.\n",
    "\n",
    "* `autopep8` : the tool that automatically formats Python code to conform to the PEP 8 style guide\n",
    "\n",
    "\n",
    "**Installation**\n",
    "\n",
    "```bash\n",
    ">python -m pip install autopep8\n",
    "```\n",
    "\n",
    "pycodestyle is installed when you install  autopep8\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### autopep8 in Visual Studio Code\n",
    "\n",
    "   The Python extension supports source code **formatting** using either autopep8 (the default), \n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### autopep8 in Jupyter Notebook\n",
    "\n",
    "Jupyter notebook extensions:\n",
    "\n",
    "* https://github.com/ipython-contrib/jupyter_contrib_nbextensions\n",
    "        \n",
    "This repository contains a collection of extensions that add functionality to the Jupyter notebook.\n",
    "\n",
    "* Install the python package\n",
    "\n",
    "```bash\n",
    ">python -m pip install jupyter_contrib_nbextensions\n",
    "```\n",
    "\n",
    "* Install javascript and css files\n",
    "\n",
    "```bash\n",
    ">jupyter contrib nbextension install --user\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 6.3 Pylint \n",
    "\n",
    "Pylint is a tool that checks for errors in Python code, tries to enforce a coding standard and looks for bad code smells\n",
    "\n",
    "http://www.pylint.org\n",
    "\n",
    "Install\n",
    "```bash\n",
    ">python -m pip install pylint \n",
    "```\n",
    "**Features**\n",
    "\n",
    "* Coding Standard: [Python's PEP8 style guide](https://www.python.org/dev/peps/pep-0008/)\n",
    "\n",
    "* Editor integration\n",
    "  \n",
    "  * Visual Studio Code,**Pylint** is enabled by default\n",
    "\n",
    "* UML diagrams: [Pyreverse: UML Diagrams for Python](https://www.logilab.org/blogentry/6883) \n",
    "\n",
    "  * Reference: [Creating UML diagrams for Python code](https://github.com/PySEE/home/blob/S2020/guide/doc/UMLPython.md)\n",
    "\n",
    "![vscode-pylint](./img/vscode-pylint.jpg)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Further Reading: Google Python Style Guide\n",
    "\n",
    "**Every major open-source project has its own style guide**: \n",
    "\n",
    "* a set of conventions (sometimes arbitrary) about how to write code for that project. \n",
    "\n",
    "It is much easier to understand a large codebase when all the code in it is in a consistent style.\n",
    "\n",
    "**Style** covers a lot of ground\n",
    "\n",
    "* use **camelCase**(驼峰命名法) for variable names \n",
    "\n",
    "* never use global variables\n",
    "\n",
    "* never use exceptions.\n",
    "\n",
    ">**camelCase** for variable names in computer programming \n",
    ">* starts with a `lowercase` letter. \n",
    ">* each next word or abbreviation begins with a **capital** letter.\n",
    ">*  no intervening spaces or punctuation.`\n",
    "\n",
    "This project **Google Python Style Guide**. \n",
    "\n",
    "* http://google.github.io/styleguide/pyguide.html\n",
    "\n",
    "holds the style guidelines we use for Google code\n",
    "\n",
    "* 中文版：https://zh-google-styleguide.readthedocs.io/en/latest/google-python-styleguide/ \n",
    "\n",
    "\n",
    "#### Further Reading：Google Style Guide\n",
    "\n",
    "[Google Style Guide](https://github.com/google/styleguide)\n",
    "\n",
    "Style guides for Google-originated open-source projects\n",
    "\n",
    "This project holds the \n",
    "\n",
    "* C++ Style Guide\n",
    "\n",
    "* Python Style Guide, \n",
    "\n",
    "* Java Style Guide, \n",
    "* ... \n",
    "\n",
    "[Google 开源项目风格指南 (中文版)](https://github.com/zh-google-styleguide/zh-google-styleguide)\n",
    "\n",
    "  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.7"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": false,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {
    "height": "calc(100% - 180px)",
    "left": "10px",
    "top": "150px",
    "width": "165px"
   },
   "toc_section_display": true,
   "toc_window_display": true
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
